#pragma once

#include "vrdatacore_global.h"
#include <QString>

namespace VrDataCore
{
	class VRDATACORE_EXPORT UnitConversionManager
	{
	public:
		struct ParameterSet
		{
			double										_sceneWorldX;
			double										_sceneWorldY;
			double										_realWorldX;
			double										_realWorldY;
		};
		static UnitConversionManager& GetInstance();
		void addConverReferencePointDMS(double sceneworldx,double sceneworldy,int realworldxd,int realworldxm,int realworldxds
			,int realworldyd,int realworldym,int realworldyds,bool updatemap = true);
		void addConverReferencePointDM(double sceneworldx,double sceneworldy,int realworldxd,double realworldxm
			,int realworldyd,double realworldym,bool updatemap = true);
		void addConverReferencePointD(double sceneworldx,double sceneworldy,double realworldx,double realworldy,bool updatemap = true);
		void getAfterConverPointSTR(double sceneworldx,double sceneworldy,double& realworldx,double& realworldy);
		void getAfterConverPointRTS(double& sceneworldx,double& sceneworldy,double realworldx,double realworldy);
		void resetConversion();
		void testReferenceUnitConversion();
	protected:
		void updateMap();
		UnitConversionManager();
		~UnitConversionManager();
	private:
		static UnitConversionManager*				_unitConversionManager;
		double									_xReference;
		double									_yReference;
		ParameterSet								_minSet;
		ParameterSet								_maxSet;
		QString									_referenceUnitConversion;
	};
}